#include "jgeneralsymbolinputpanel.h"
#include "ui_jgeneralsymbolinputpanel.h"
#include "inputmethod/jabstractinputpanel_p.h"
#include "widgets/jvkbutton.h"
#include <QTECore/QTEGlobal>

namespace QTE
{

SymbolPanel_register(JGeneralSymbolInputPanel, LGG_GeneralEnglish);

class Q_DECL_HIDDEN JGeneralSymbolInputPanelPrivate : public JAbstractInputPanelPrivate
{
public:
	~JGeneralSymbolInputPanelPrivate() override;
	void init(JAbstractInputPanel *q_ptr) override;

public:
	Ui::JGeneralSymbolInputPanel *ui;
};

JGeneralSymbolInputPanelPrivate::~JGeneralSymbolInputPanelPrivate()
{
	delete ui;
}

void JGeneralSymbolInputPanelPrivate::init(JAbstractInputPanel *q_ptr)
{
	JAbstractInputPanelPrivate::init(q_ptr);
	ui = new Ui::JGeneralSymbolInputPanel();
	ui->setupUi(J_RCT(JGeneralSymbolInputPanel*, q_ptr));
	ui->horizontalLayout_5->insertWidget(ui->horizontalLayout_5->count() - 1, m_backSpaceButton);
}

/*------------------------------------------------------------------------------------------------*/

JGeneralSymbolInputPanel::JGeneralSymbolInputPanel(QWidget *parent) :
	JAbstractInputPanel(new JGeneralSymbolInputPanelPrivate(), parent)
{
	Q_D(JGeneralSymbolInputPanel);
	connect(d->ui->tb_tab, &QToolButton::clicked, this, &JGeneralSymbolInputPanel::on_tb_tabClicked);
}

JGeneralSymbolInputPanel::~JGeneralSymbolInputPanel()
{

}

void JGeneralSymbolInputPanel::on_tb_tabClicked()
{
	keyClicked(d_func()->ui->tb_tab);
	emit textInput("\t");
}

} //namespace QTE
